/* wins.h is part of VIP program
 * Written by J. Salvador Arias, 2010
 *      CONICET, INSUE, Instituto Miguel Lillo,
 *      Miguel Lillo 205, S.M. de Tucuman (4000)
 *      Tucuman, Argentina
 *      e-mail: jsalarias@csnat.unt.edu.ar
 *
 * VIP is a free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation and
 * Creative Commons.
 *
 * This file and the VIP program is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * To view a copy of this license, visit
 * http://creativecommons.org/licenses/GPL/2.0/
 * or send a letter to
 * Creative Commons, 171 Second Street, Suite 300,
 * San Francisco, California, 94105, USA.
 */

#ifndef WINDOWED_INTERFACE_HEADER_INCLUDED
#define WINDOWED_INTERFACE_HEADER_INCLUDED

#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>

/* ------ Windowed interface ------ */
/* General functions and structures used by the graphic user interface. */

#include "biogeo.h"
#include "grid.h"

/* ------ General functions ------ */
GtkWidget* CreateWindow (gchar* name, gint x, gint y, gint sizeX, gint sizeY, GCallback OnDelete, GtkWidget* box);

GtkWidget* AddMenuToBar (GtkWidget* menu, gchar* name, GtkWidget* menuBar);
GtkWidget* CreateMenuItem (GtkWidget* menu, gchar* name, GtkAccelGroup* accelGroup, guint key,
                           GdkModifierType modifier, GCallback func, gpointer data);
GtkWidget* CreateMenuItemCheck (GtkWidget* menu, gchar* name, GtkAccelGroup* accelGroup, guint key,
                                GdkModifierType modifier, GCallback func, gpointer data);
GtkWidget* CreateMenuItemRadio (GtkWidget* menu, gchar* name, GtkAccelGroup* accelGroup, guint key,
                                GdkModifierType modifier, GCallback func, gpointer data, GSList* group);
void CreateMenuSeparator (GtkWidget* menu);

GtkWidget* CreateEntry (gchar* label, GtkBox* box);

GtkFileFilter* CreateFileFilter (gchar* name, gchar* pattern, GtkWidget* fileChooser);

/* ------ Global windows ------ */

/* --- Main window --- */
GtkWidget* mainWindow;
#define GETMAINWIN mainWindow

void StartMainWindow ();
void OnChangeRec ();

/* --- Treee View window --- */
GtkWidget* treeViewWindow;
#define GETTREEWIN treeViewWindow

void StartTreeViewWindow ();
void OpenNewTree ();
void OnChangeTree (GList* nuTree);
void OnUpdateTree ();
void SetRecEdition (SFLAG mode);

/* --- Map window --- */
GtkWidget* mapWindow;
#define GETMAPWIN mapWindow

void StartMapWindow ();
void ChangeGeo ();
void ActivateGrid (SFLAG mode);
void SetEdition (SFLAG mode);

void PaintNewGeoRef (GEOREF* geo);

/* ------ Other globals ------ */
GNode* activeNode;
GList* activeTree;

#endif
